package org.lqq.serverRegisterAndFinder.serverFinder.etcd;

import org.lqq.entity.ServerAddress;
import org.lqq.serverRegisterAndFinder.etcd.EtcdData;
import org.lqq.serverRegisterAndFinder.serverFinder.AbstractServerFinder;

import java.util.Collection;

/**
 * Created by 李清泉 on 2017/11/2.
 *
 * @remark
 */
public class EtcdServerFinder extends AbstractServerFinder{


    @Override
    public Collection<ServerAddress> discoverServerAddress(String serverName) {
        return EtcdData.getInstance().get(serverName);
    }

    @Override
    public Collection<String> discoverAllRegisterdServerName() {
        return EtcdData.getInstance().getAllServerName();
    }
}
